<template>
	<div class="margin_top widthText word_wrap radius ffffff boxShadow paddingtb15 pointer" @click="goInfo(child)">
		<div class="paddinglr">
			<div class="text_f color_three margin_top1 yihang">{{child.name}}</div>
			<div class="flexleft margin_top1">
				<div class="vipBox margin_right1" v-if="child.is_vip==1">VIP</div>
				<div class="num">编号：{{child.id}}</div>
			</div>
			<div class="flexbetween margin_top1">
				<div class="flexleft" v-if="child.teacher">
					<img class="userImg margin_right1" :src="child.teacher.avatar" alt="">
					<div class="text_b color_three">{{child.teacher.username}}</div>
				</div>
				<div class="flexleft" v-else>
					<img class="userImg margin_right1" :src="child.myteacher.avatar" alt="">
					<div class="text_b color_three">{{child.myteacher.username}}</div>
				</div>
				<div>
					<span class="text_b color_red">￥</span>
					<span class="text_ht color_red">{{child.price}}</span>
				</div>
				<div class="flexright">
					<div class="themeBtn" v-if="!child.is_free">立即购买</div>
				</div>
			</div>
		</div>
	</div>
</template>

<script>
	export default {
		props: {
			child: {
				type: Object,
				default: () => {
					return {}
				}
			}
		},
		data() {
			return {

			}
		},
		methods: {
			goInfo(child) { //辅导、资料详情
				if (child.type == 2) {
					this.$router.push({
						path: "/fineCourse/coach",
						query: {
							id: child.id
						}
					})
				} else {
					this.$router.push({
						path: "/information/informationInfo",
						query: {
							id: child.id
						}
					})
				}
			}
		}
	}
</script>

<style lang="scss" scoped>
	.widthText {
		width: 580px;
	}

	.paddinglr {
		padding: 0 10px;
	}

	.vipBox {
		padding: 5px 10px;
		background: rgba(255, 0, 0, .1);
		border-radius: 6px 6px 6px 6px;
		font-size: 12px;
		font-family: PingFang SC-Medium, PingFang SC;
		font-weight: 500;
		color: #FF0000;
	}

	.num {
		padding: 5px 10px;
		background: rgba(153, 153, 153, .1);
		border-radius: 6px 6px 6px 6px;
		font-size: 12px;
		font-family: PingFang SC-Medium, PingFang SC;
		font-weight: 500;
		color: #999999;
	}

	.userImg {
		width: 22px;
		height: 22px;
		border-radius: 50%;
	}
</style>